package org.example.api.marker.controller;

import org.example.api.marker.controller.fallback.UidControllerFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author Wills
 * @date 2020/5/26
 */
@FeignClient(
        name = "marker-server",
        contextId = "marker-server",
        fallback = UidControllerFallback.class,
        path = "/marker-server/uid"
)
public interface UidControllerFeign {

    @GetMapping
    Long getUid(@RequestParam(name = "appId", required = false, defaultValue = "0") long appId);

    @GetMapping("/batch")
    List<Long> batchGetUid(@RequestParam(name = "appId", required = false, defaultValue = "0") long appId,
                                  @RequestParam("size") int size) throws Exception;

    @GetMapping(value = "/parse")
    String parse(@RequestParam("uid") long uid);
}
